import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
import menu_model from "./model/menu"
import role_model from "./model/role"
import user_model from "./model/user"
import cate_model from "./model/category"
import spec_model from "./model/specs"
import good_model from "./model/goods"
export default new Vuex.Store({
  state: {
    nav_list: []
  },
  mutations: {
    navListMutations(state){
      const navList = JSON.parse(localStorage.getItem("loginData")|| '{}');
      if(navList){
        state.nav_list = navList.menus
      }
    }
  },
  actions: {
  },
  modules: {
    menu_model: menu_model,
    role_model: role_model,
    user_model: user_model,
    cate_model: cate_model,
    spec_model: spec_model,
    good_model: good_model
  }
})
